import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:恋恋
 * Date:2022-11-21
 * Time:17:11
 */
public class TestDemo1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[3*n];
        Arrays.fill(arr,0);
        for (int i = 0; i < 3*n; i++) {
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);
        int count = 0;
        for (int i = n; i < n*2 ; i++) {
            count += arr[i];
        }
        System.out.println(count);
    }
}
